package com.clkj.zhonghui.dao.product;

import com.clkj.zhonghui.pojo.product.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @Author：周佳润
 * @Date：2024/7/11 上午11:15
 */
@Repository
public interface ProductMapper extends Mapper<Product> {

    /**
     * 添加商品
     *
     * @param product
     * @return
     */
    @Insert("insert into t_zh_product  values " +
            "(#{productName},#{productPic},#{shopId}," +
            "#{categoryId},#{productTitle},#{inventory}," +
            "#{productSort},#{productSales},#{productStatus},#{productFlag}," +
            "#{productPrice})")
    @Options(useGeneratedKeys = true, keyProperty = "productId")
    void addProduct(Product product);
}
